package com.lin.mapper;

import com.lin.entity.AlbumEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AlbumMapper {


    /**
     * 根据用户id查询相册
     * @param userId
     * @return
     */
    @Select("select * from album where create_p_id = #{userId}")
    AlbumEntity getAlbum(Integer userId);

    /**
     * 新建相册
     * @param albumEntity
     */
    void saveAlbum(AlbumEntity albumEntity);

    /**
     * 更新相册
     * @param albumEntity
     */
    void updateAlbum(AlbumEntity albumEntity);

    @Delete("delete from album where id = #{id}")
    void deleteAlbum(Integer id);
}
